package com.bluexmicro.bluetooth.model


import android.bluetooth.le.ScanSettings

/**
 * This class represents the possible scan modes
 *
 * 这个类代表了可能的扫描模式
 */
enum class ScanMode(val value: Int) {
    /**
     * A special Bluetooth LE scan mode. Applications using this scan mode will passively listen for
     * other scan results without starting BLE scans themselves.
     *
     * 一个特殊的蓝牙LE扫描模式。使用此扫描模式的应用程序将被动地监听其他扫描结果,而不会自己启动BLE扫描。
     */
    OPPORTUNISTIC(-1),

    /**
     * Perform Bluetooth LE scan in balanced power mode. Scan results are returned at a rate that
     * provides a good trade-off between scan frequency and power consumption.
     *
     * 以平衡功耗模式执行蓝牙LE扫描。扫描结果的返回速率在扫描频率和功耗之间达到了很好的平衡。
     */
    BALANCED(ScanSettings.SCAN_MODE_BALANCED),

    /**
     * Scan using highest duty cycle. It's recommended to only use this mode when the application is
     * running in the foreground.
     *
     * 使用最高占空比进行扫描。建议仅在应用程序在前台运行时使用此模式。
     */
    LOW_LATENCY(ScanSettings.SCAN_MODE_LOW_LATENCY),

    /**
     * Perform Bluetooth LE scan in low power mode. This is the default scan mode as it consumes the
     * least power. This mode is enforced if the scanning application is not in foreground.
     *
     *  以低功耗模式执行蓝牙LE扫描。这是默认的扫描模式,因为它消耗最少的电量。如果扫描应用程序不在前台,则强制执行此模式。
     */
    LOW_POWER(ScanSettings.SCAN_MODE_LOW_POWER);
}